package com.it.conformity.testdemo.dao;

import com.it.conformity.testdemo.pojo.SysUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * @Author: 王文龙
 * @Date: 2020/6/1119:22
 * @Version: 1.0
 * @Describe: 描述:
 */
public interface SysUserDao {

    /**
     * 新增
     * @param sysUser 用户实体类
     * @return true/false
     */
    @Insert("insert into sys_user(" +
            "name,\n" +
            "age,\n" +
            "sex,\n" +
            "phone,\n" +
            "portrait)" +
            "value(" +
            "#{name},\n" +
            "#{age},\n" +
            "#{sex},\n" +
            "#{phone},\n" +
            "#{portrait})")
    boolean insert(SysUser sysUser);

    /**
     * id查询
     * @param id 主键
     * @return SysUser
     */
    @Select("select * from sys_user where id=#{id}")
    SysUser findById(Integer id);
}
